3.344 \(\int (a+b \sec (e+f x))^3 (d \tan (e+f x))^n \, dx\)

Optimal. Leaf size=245 \[ \frac{3 a^2 b \sec (e+f x) \cos ^2(e+f x)^{\frac{n+2}{2}} (d \tan (e+f x))^{n+1} \text{Hypergeometric2F1}\left (\frac{n+1}{2},\frac{n+2}{2},\frac{n+3}{2},\sin ^2(e+f x)\right )}{d f (n+1)}+\frac{a^3 (d \tan (e+f x))^{n+1} \text{Hypergeometric2F1}\left (1,\frac{n+1}{2},\frac{n+3}{2},-\tan ^2(e+f x)\right )}{d f (n+1)}+\frac{b^3 \sec ^3(e+f x) \cos ^2(e+f x)^{\frac{n+4}{2}} (d \tan (e+f x))^{n+1} \text{Hypergeometric2F1}\left (\frac{n+1}{2},\frac{n+4}{2},\frac{n+3}{2},\sin ^2(e+f x)\right )}{d f (n+1)}+\frac{3 a b^2 (d \tan (e+f x))^{n+1}}{d f (n+1)} \]

[Out]

(3*a*b^2*(d*Tan[e + f*x])^(1 + n))/(d*f*(1 + n)) + (a^3*Hypergeometric2F1[1, (1 + n)/2, (3 + n)/2, -Tan[e + f*
x]^2]*(d*Tan[e + f*x])^(1 + n))/(d*f*(1 + n)) + (3*a^2*b*(Cos[e + f*x]^2)^((2 + n)/2)*Hypergeometric2F1[(1 + n
)/2, (2 + n)/2, (3 + n)/2, Sin[e + f*x]^2]*Sec[e + f*x]*(d*Tan[e + f*x])^(1 + n))/(d*f*(1 + n)) + (b^3*(Cos[e
+ f*x]^2)^((4 + n)/2)*Hypergeometric2F1[(1 + n)/2, (4 + n)/2, (3 + n)/2, Sin[e + f*x]^2]*Sec[e + f*x]^3*(d*Tan
[e + f*x])^(1 + n))/(d*f*(1 + n))

________________________________________________________________________________________

Rubi [A]  time = 0.271727, antiderivative size = 245, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.261, Rules used = {3886, 3476, 364, 2617, 2607, 32} \[ \frac{3 a^2 b \sec (e+f x) \cos ^2(e+f x)^{\frac{n+2}{2}} (d \tan (e+f x))^{n+1} \, _2F_1\left (\frac{n+1}{2},\frac{n+2}{2};\frac{n+3}{2};\sin ^2(e+f x)\right )}{d f (n+1)}+\frac{a^3 (d \tan (e+f x))^{n+1} \, _2F_1\left (1,\frac{n+1}{2};\frac{n+3}{2};-\tan ^2(e+f x)\right )}{d f (n+1)}+\frac{3 a b^2 (d \tan (e+f x))^{n+1}}{d f (n+1)}+\frac{b^3 \sec ^3(e+f x) \cos ^2(e+f x)^{\frac{n+4}{2}} (d \tan (e+f x))^{n+1} \, _2F_1\left (\frac{n+1}{2},\frac{n+4}{2};\frac{n+3}{2};\sin ^2(e+f x)\right )}{d f (n+1)} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[e + f*x])^3*(d*Tan[e + f*x])^n,x]

[Out]

(3*a*b^2*(d*Tan[e + f*x])^(1 + n))/(d*f*(1 + n)) + (a^3*Hypergeometric2F1[1, (1 + n)/2, (3 + n)/2, -Tan[e + f*
x]^2]*(d*Tan[e + f*x])^(1 + n))/(d*f*(1 + n)) + (3*a^2*b*(Cos[e + f*x]^2)^((2 + n)/2)*Hypergeometric2F1[(1 + n
)/2, (2 + n)/2, (3 + n)/2, Sin[e + f*x]^2]*Sec[e + f*x]*(d*Tan[e + f*x])^(1 + n))/(d*f*(1 + n)) + (b^3*(Cos[e
+ f*x]^2)^((4 + n)/2)*Hypergeometric2F1[(1 + n)/2, (4 + n)/2, (3 + n)/2, Sin[e + f*x]^2]*Sec[e + f*x]^3*(d*Tan
[e + f*x])^(1 + n))/(d*f*(1 + n))

Rule 3886

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Int[ExpandI
ntegrand[(e*Cot[c + d*x])^m, (a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 0]

Rule 3476

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[b/d, Subst[Int[x^n/(b^2 + x^2), x], x, b*Tan[c + d
*x]], x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rule 364

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(a^p*(c*x)^(m + 1)*Hypergeometric2F1[-
p, (m + 1)/n, (m + 1)/n + 1, -((b*x^n)/a)])/(c*(m + 1)), x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rule 2617

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[((a*Sec[e +
f*x])^m*(b*Tan[e + f*x])^(n + 1)*(Cos[e + f*x]^2)^((m + n + 1)/2)*Hypergeometric2F1[(n + 1)/2, (m + n + 1)/2,
(n + 3)/2, Sin[e + f*x]^2])/(b*f*(n + 1)), x] /; FreeQ[{a, b, e, f, m, n}, x] &&  !IntegerQ[(n - 1)/2] &&  !In
tegerQ[m/2]

Rule 2607

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rubi steps

\begin{align*} \int (a+b \sec (e+f x))^3 (d \tan (e+f x))^n \, dx &=\int \left (a^3 (d \tan (e+f x))^n+3 a^2 b \sec (e+f x) (d \tan (e+f x))^n+3 a b^2 \sec ^2(e+f x) (d \tan (e+f x))^n+b^3 \sec ^3(e+f x) (d \tan (e+f x))^n\right ) \, dx\\ &=a^3 \int (d \tan (e+f x))^n \, dx+\left (3 a^2 b\right ) \int \sec (e+f x) (d \tan (e+f x))^n \, dx+\left (3 a b^2\right ) \int \sec ^2(e+f x) (d \tan (e+f x))^n \, dx+b^3 \int \sec ^3(e+f x) (d \tan (e+f x))^n \, dx\\ &=\frac{3 a^2 b \cos ^2(e+f x)^{\frac{2+n}{2}} \, _2F_1\left (\frac{1+n}{2},\frac{2+n}{2};\frac{3+n}{2};\sin ^2(e+f x)\right ) \sec (e+f x) (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac{b^3 \cos ^2(e+f x)^{\frac{4+n}{2}} \, _2F_1\left (\frac{1+n}{2},\frac{4+n}{2};\frac{3+n}{2};\sin ^2(e+f x)\right ) \sec ^3(e+f x) (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac{\left (3 a b^2\right ) \operatorname{Subst}\left (\int (d x)^n \, dx,x,\tan (e+f x)\right )}{f}+\frac{\left (a^3 d\right ) \operatorname{Subst}\left (\int \frac{x^n}{d^2+x^2} \, dx,x,d \tan (e+f x)\right )}{f}\\ &=\frac{3 a b^2 (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac{a^3 \, _2F_1\left (1,\frac{1+n}{2};\frac{3+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac{3 a^2 b \cos ^2(e+f x)^{\frac{2+n}{2}} \, _2F_1\left (\frac{1+n}{2},\frac{2+n}{2};\frac{3+n}{2};\sin ^2(e+f x)\right ) \sec (e+f x) (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac{b^3 \cos ^2(e+f x)^{\frac{4+n}{2}} \, _2F_1\left (\frac{1+n}{2},\frac{4+n}{2};\frac{3+n}{2};\sin ^2(e+f x)\right ) \sec ^3(e+f x) (d \tan (e+f x))^{1+n}}{d f (1+n)}\\ \end{align*}

Mathematica [A]  time = 3.36643, size = 238, normalized size = 0.97 \[ \frac{d \left (-\tan ^2(e+f x)\right )^{-n/2} (d \tan (e+f x))^{n-1} \left (9 a^2 b (n+1) \sqrt{-\tan ^2(e+f x)} \sec (e+f x) \text{Hypergeometric2F1}\left (\frac{1}{2},\frac{1-n}{2},\frac{3}{2},\sec ^2(e+f x)\right )-3 a^3 \left (-\tan ^2(e+f x)\right )^{\frac{n+2}{2}} \text{Hypergeometric2F1}\left (1,\frac{n+1}{2},\frac{n+3}{2},-\tan ^2(e+f x)\right )+b^3 (n+1) \sqrt{-\tan ^2(e+f x)} \sec ^3(e+f x) \text{Hypergeometric2F1}\left (\frac{3}{2},\frac{1-n}{2},\frac{5}{2},\sec ^2(e+f x)\right )+9 a b^2 \left (\sqrt{-\tan ^2(e+f x)}-\left (-\tan ^2(e+f x)\right )^{\frac{n+2}{2}}\right )\right )}{3 f (n+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[e + f*x])^3*(d*Tan[e + f*x])^n,x]

[Out]

(d*(d*Tan[e + f*x])^(-1 + n)*(9*a^2*b*(1 + n)*Hypergeometric2F1[1/2, (1 - n)/2, 3/2, Sec[e + f*x]^2]*Sec[e + f
*x]*Sqrt[-Tan[e + f*x]^2] + b^3*(1 + n)*Hypergeometric2F1[3/2, (1 - n)/2, 5/2, Sec[e + f*x]^2]*Sec[e + f*x]^3*
Sqrt[-Tan[e + f*x]^2] - 3*a^3*Hypergeometric2F1[1, (1 + n)/2, (3 + n)/2, -Tan[e + f*x]^2]*(-Tan[e + f*x]^2)^((
2 + n)/2) + 9*a*b^2*(Sqrt[-Tan[e + f*x]^2] - (-Tan[e + f*x]^2)^((2 + n)/2))))/(3*f*(1 + n)*(-Tan[e + f*x]^2)^(
n/2))

________________________________________________________________________________________

Maple [F]  time = 180., size = 0, normalized size = 0. \begin{align*} \int \left ( a+b\sec \left ( fx+e \right ) \right ) ^{3} \left ( d\tan \left ( fx+e \right ) \right ) ^{n}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(f*x+e))^3*(d*tan(f*x+e))^n,x)

[Out]

int((a+b*sec(f*x+e))^3*(d*tan(f*x+e))^n,x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \sec \left (f x + e\right ) + a\right )}^{3} \left (d \tan \left (f x + e\right )\right )^{n}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e))^3*(d*tan(f*x+e))^n,x, algorithm="maxima")

[Out]

integrate((b*sec(f*x + e) + a)^3*(d*tan(f*x + e))^n, x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (b^{3} \sec \left (f x + e\right )^{3} + 3 \, a b^{2} \sec \left (f x + e\right )^{2} + 3 \, a^{2} b \sec \left (f x + e\right ) + a^{3}\right )} \left (d \tan \left (f x + e\right )\right )^{n}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e))^3*(d*tan(f*x+e))^n,x, algorithm="fricas")

[Out]

integral((b^3*sec(f*x + e)^3 + 3*a*b^2*sec(f*x + e)^2 + 3*a^2*b*sec(f*x + e) + a^3)*(d*tan(f*x + e))^n, x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (d \tan{\left (e + f x \right )}\right )^{n} \left (a + b \sec{\left (e + f x \right )}\right )^{3}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e))**3*(d*tan(f*x+e))**n,x)

[Out]

Integral((d*tan(e + f*x))**n*(a + b*sec(e + f*x))**3, x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \sec \left (f x + e\right ) + a\right )}^{3} \left (d \tan \left (f x + e\right )\right )^{n}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e))^3*(d*tan(f*x+e))^n,x, algorithm="giac")

[Out]

integrate((b*sec(f*x + e) + a)^3*(d*tan(f*x + e))^n, x)